
<?php
error_reporting(E_ALL);

include_once('../controller/includes/db_access.php');
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script
src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="styles/style.css" type="text/css" />
<!--[if lte IE 7]>
<link rel="stylesheet" href="style_ie.css" />
<![endif]-->
<title>dbme!!!!</title>
</head>
<body>
<div id="bloc_page">
<header>
 <a href="#"><img src="../images/dBmelogo.png" alt="referentie" alt="dbme!" /></a>
</header>  
 <nav>
    <?php include_once('header.php'); ?>
</nav>
 <section>
  <aside>
  <!--right side baar -->  
  </aside>
     
  <article>
<?php  if ($_GET['order']) 
{

$query_korting="SELECT * FROM cadeaubon WHERE type = 'A' order by ".$_GET['order'] . " " . $_GET['dir'];

}
else 
{

$query_korting="SELECT * FROM cadeaubon order by geldig_tot asc";

}
$result_korting=mysql_query($query_korting);


$num_korting=mysql_numrows($result_korting);

?>
<table width="800" border="0" cellspacing="1" cellpadding="0">
<tr style="color:#000;font-weight:bold">
<td width="200" valign="top" colspan="8">KORTINGEN OVERZICHT</td>
</tr>
</tr>
 <tr>
 <td colspan="8" class="title" style="width: 100%;"><div><a href="korting_add.php" >add korting</a></div></td>
</tr>
<tr style="color:#000;font-weight:bold">
<td width="200" valign="top">NAAM &nbsp;&nbsp;<a href="korting_list.php?order=naam&dir=desc"><img src="images/pijl_d.png" width="12" height="12" border="0"></a>&nbsp;<a href="korting_list.php?order=naam&dir=asc"><img src="images/pijl_u.png" width="12" height="12" border="0"></a></td>
<td width="100" valign="top">KORTING</td>
<td width="110" valign="top">CODE</td>
<td width="100" valign="top">VAN &nbsp;&nbsp;<a href="korting_list.php?order=geldig_van&dir=desc"><img src="images/pijl_d.png" width="12" height="12" border="0"></a>&nbsp;<a href="korting_list.php?order=geldig_van&dir=asc"><img src="images/pijl_u.png" width="12" height="12" border="0"></a></td>
<td width="100" valign="top">TOT &nbsp;&nbsp;<a href="korting_list.php?order=geldig_tot&dir=desc"><img src="images/pijl_d.png" width="12" height="12" border="0"></a>&nbsp;<a href="korting_list.php?order=geldig_tot&dir=asc"><img src="images/pijl_u.png" width="12" height="12" border="0"></a></td>
<td width="130" valign="top">AKTIEF &nbsp;&nbsp;<a href="korting_list.php?order=aktief&dir=desc"><img src="images/pijl_d.png" width="12" height="12" border="0"></a>&nbsp;<a href="korting_list.php?order=aktief&dir=asc"><img src="images/pijl_u.png" width="12" height="12" border="0"></a></td>
<td width="30" valign="top"></td>
<td width="30" valign="top"></td>
</tr>

<?php

for ($z=0;$z<$num_korting;$z++) {

$tr_class = ($z % 2 == 0) ? 'tddark' : 'tdlight'; 

?>

<tr class="<?php echo $tr_class; ?>">

<td valign="top"><?php echo mysql_result($result_korting,$z,"naam"); ?></td>

<td valign="top"><?php echo mysql_result($result_korting,$z,"korting"); ?><?php echo mysql_result($result_korting,$z,"type")=='A'? '%' : ' &euro;'; ?></td>

<td valign="top"><?php echo mysql_result($result_korting,$z,"code"); ?></td>

<td valign="top"><?php echo mysql_result($result_korting,$z,"geldig_van"); ?></td>

<td  valign="top"><?php echo mysql_result($result_korting,$z,"geldig_tot"); ?></td>

<td valign="top"><?php echo mysql_result($result_korting,$z,"aktief")=='Y'? 'Y' : 'N'; ?></td>

<td valign="top"><a href="korting_edit.php?pid=<?php echo mysql_result($result_korting,$z,"cadeaubon_id"); ?>"><img src="images/btn-edit.gif" alt="BEWERKEN" width="21" height="19" border="0"></a></td>

<td valign="top"><a href="korting_del.php?pid=<?php echo mysql_result($result_korting,$z,"cadeaubon_id"); ?>"><img src="images/btn-del.gif" alt="VERWIJDEREN" width="21" height="19" border="0"></a></td>
</tr>


<?php } ?>


  </tbody>
   </table>
  </article>
 
    <aside>
  <!--right side baar -->
       
        
   </aside>
</section>
 
 <footer>  
<p>Lorem ipsum dolor sit amet...</p>
<p>Vivamus sed libero nec mauris pulvinar facilisis ut non sem...</p>
<p>Phasellus ligula massa, congue ac vulputate non, dignissim at augue...</p>
</footer>
</div>
</body>
</html>

